#ifndef MYEMOTIONWIDGET_H
#define MYEMOTIONWIDGET_H

#include <QWidget>
#include <QTableWidget>

#include <QLabel>

namespace Ui {
class MyEmotionWidget;
}
//表情
class MyEmotionWidget : public QTableWidget
{
    Q_OBJECT

public:
    explicit MyEmotionWidget(QWidget *parent = 0);
    ~MyEmotionWidget();    
    void setRowAndColumn(int row, int column);
    void setEmotionSize(QSize emotionSize);
    void setEmotionMovieSize(QSize emotionMovieSize);
    void setMaxRow(int maxRow);
    void addEmotionItem(QString fileName , QString toolTip);
    void initTableWidget();

private slots:
    void addEmotion(QString filename);
private:
    Ui::MyEmotionWidget *ui;
    void initEmotion();
    QList<QString> m_emotionList;
    int m_tableRow;
    int m_tableColumn;
    QSize m_emotionSize;
    QSize m_emotionMovieSize;
    int m_maxRow;
    int m_preRow;
    int m_preColumn;
protected:
    void loadStyleSheet();
    void showDynamicEmotion(QPoint cursorPos);
signals:
    void signalItemClicked(QString);
};

class MyEmotionItemWidget:public QLabel
{
    Q_OBJECT
public:
    explicit MyEmotionItemWidget(QString fileName);
private:
    void enterEvent(QEvent* event);
    void leaveEvent(QEvent* event);
    QString m_fielname;
private:
   void mousePressEvent(QMouseEvent* event);                 // 鼠标单击事件
signals:
void emotionClicked(QString);// 单击产生的信号
};
#endif // MYEMOTIONWIDGET_H
